<?php

namespace globalunit\model;

use globalunit\model\RedisPOB;
use QYS\Util\Debug;
use QYS\Core\Config as CoreConfig;
use globalunit\utils\Config;
use QYS\Log\Log;

class AdvChildModel extends BaseModel
{
    public $id              = 0;
    public $aid             = 0;
    public $url             = "";
    public $created_at      = "";
    public $updated_at      = "";
    public $deleted_at      = "";

    protected $_validator   = [
        'id' => [
            'ac' => 'id'
        ]
    ];

    public function __construct()
    {
        parent::__construct('yyz_adv_child');
    }

    public function save($except = [])
    {
        if ($this->id > 0) {
            $this->updated_at = date("Y-m-d H:i:s");
            return parent::save();
        }
    }
    public function insert()
    {
        $this->created_at = date("Y-m-d H:i:s");
        return parent::insert();
    }

    public function del()
    {
        if ($this->id > 0) {
            $this->deleted_at = date("Y-m-d H:i:s");
            return parent::save();
        }
    }


    public function toArray()
    {
        $a = parent::toarray();
        return $a;
    }
}
